<template>
	<u-modal
		:show="show"
		:showCancelButton="true"
		title="输入备注"
		@confirm="successHandle"
		@cancel="cancelHandle"
	>
		<u-form labelPosition="left" :rules="rules" :model="tagInfo" :borderBottom="false" ref="uFormRef">
            <u-form-item label="" prop="name" :borderBottom="false" ref="phone">
                <u-input v-model="tagInfo.name" placeholder="房间类型"></u-input>
            </u-form-item>
            <u-form-item label="" prop="position" :borderBottom="false" ref="item1">
                <u-input v-model="tagInfo.position" placeholder="房间方位"></u-input>
            </u-form-item>
        </u-form>
	</u-modal>
</template>
<script>

export default {
	data() {
		return {
			show: false,
			tagInfo: {
				name: '',
				position: ''
			},
			rules: {
				'name': {
					type: 'string',
					required: true,
					message: '请填写房间类型',
					trigger: ['blur', 'change']
				},
				'position': {
					type: 'string',
					required: true,
					message: '请填写房间方位',
					trigger: ['blur', 'change']
				},
			}
		};
	},
	mounted() {

	},
	methods: {
		showDialog(item) {
			this.tagInfo = item
			this.show = true
		},
		successHandle() {
			this.$refs.uFormRef.validate().then(res => {
				uni.$u.toast('校验通过')
				this.cancelHandle()
			}).catch(errors => {
				uni.$u.toast('校验失败')
			})
		},
		cancelHandle() {
			this.show = false
		}
	}
}

</script>
<style lang="scss" scoped>
.slot-content {
	width: 100%;
	height: 100%;
}
</style>
